package top.asteam.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.asteam.springcloud.entity.CommonResult;
import top.asteam.springcloud.entity.Payment;
import top.asteam.springcloud.service.IPaymentFeignService;

import javax.annotation.Resource;

/**
 * @Author Rock Wang
 * @Time 2021/4/20
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderFeignController {

    @Resource
    private IPaymentFeignService paymentFeignService;

    @GetMapping("/payment/get")
    public CommonResult<Payment> getById(@RequestParam Long id) {
        return paymentFeignService.getById(id);
    }

    @GetMapping("/payment/timeout")
    String PaymentFeignTimeout(){
        return paymentFeignService.PaymentFeignTimeout();
    }

}
